<?php
namespace app\share\controller;

use app\share\model\UploadImg;

class UploadImage
{
    public function __construct()
    {
        $this->upload_img = new UploadImg();
    }
    /**
     * @img   file   图片名称
     * @return  string  图片相对路径
     */
    public function uploadImage()
    {
        $file = isset($_FILES['img']) ? $_FILES['img'] : "";
        if( empty($file) )
        {
            return ['code'=>-2003, 'msg'=>"图片资源不能为空"];
        }
        return $this->upload_img->uploadPicture($file);
    }



}